package com.demo;

import com.demo.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@EnableAutoConfiguration
public class Demo {

    @Autowired
    private DemoService demoService;

    @RequestMapping("/")
    String home() {

        return demoService.saySomething();
    }

    @RequestMapping("/hello/{name}")
    String index(@PathVariable String name) {
        return "Hello " + name + "!!!";
    }
}
